#pragma once

#include "iresource.h"
#include "external/tinyxml/tinyxml2.h"

#include <string>
#include <vector>

namespace renderit
{
	namespace messiah
	{
		class resource_material_layer
		{
		public:
			bool deserialize(tinyxml2::XMLElement* elem);

		public:
			const std::string & get_param(const char * key) const;

		public:
			struct parameter
			{
				std::string key;
				std::string val;
			};

		public:
			std::string layer_name_;
			std::string shader_name_;
			std::vector<parameter> parameters_;
		};

		class resource_material : public iresource
		{
		public:
			resource_material(repo_item * item);

		public:
			~resource_material() {}

		public:
			bool load_resource() override;

		public:

		public:
			std::string name_;
			std::vector<resource_material_layer> layers_;
			int flag_;
		};

		typedef core::ref_ptr<resource_material> resource_material_ptr;
	}
}